# Contributor: John Regan <john@jrjrtech.com>
# Maintainer: Laurent Bercot <ska-devel@skarnet.org>
pkgname=execline
pkgver=2.9.5.1
pkgrel=0
pkgdesc="A small scripting language, to be used in place of a shell in non-interactive scripts."
url=https://skarnet.org/software/execline/
arch="all"
license="ISC"
options="!check"
makedepends="skalibs-dev>=2.14"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc"
source="https://skarnet.org/software/execline/execline-$pkgver.tar.gz"

build() {
	./configure \
		--enable-shared \
		--enable-static \
		--disable-allstatic \
		--libdir=/usr/lib \
		--with-dynlib=/lib \
		--enable-multicall
	make
}

package() {
	make DESTDIR="$pkgdir" install
	# Compat symlink for #!/usr/bin/execlineb shebangs, remove if usrmerge
	mkdir -p "$pkgdir/usr/bin"
	ln -s ../../bin/execlineb "$pkgdir/usr/bin/execlineb"
}

doc() {
	default_doc
	mkdir -p "$subpkgdir/usr/share/doc"
	cp -a "$builddir/doc" "$subpkgdir/usr/share/doc/$pkgname"
}

static() {
	default_static
	rmdir -p "$pkgdir"/usr/lib || :
}

sha512sums="
11bfd825b0b72cba118eff9ecb97672d0c015e0bd50c7c8f83e101ee41c323b3a3c82e42fed75b6bc65ab6edb85a8bbeef8900b594cf651825b6313a5123c88f  execline-2.9.5.1.tar.gz
"
